<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
     String path=request.getContextPath();
      String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Insert title here</title>
    <link href="<%=basePath%>css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
    <script src="<%=basePath%>js/jquery.min.js"></script>
    <script src="<%=basePath%>js/scripts.js"></script>
    <link href="<%=basePath%>css/styles.css" rel="stylesheet">
    <link href="<%=basePath%>css/style.css" rel="stylesheet" type="text/css" media="all" />
    <script src="<%=basePath%>js/jquery-1.11.0.js"></script>
    <link rel="stylesheet" href="<%=basePath%>layui/css/layui.css" media="all"/>
    <script src="<%=basePath%>layui/layui.js"></script>	
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Real Home Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<style type="text/css">
.dome20{
margin:0 auto;
float: left;
}
</style>
</head>
<body>

<div class="header">
	<div class="container">
			<div class="logo">
				<h1><a href="welcome.jsp">Cloud renting</a></h1>
			</div>
			<ul class="right-icons">
			    <li><span ><i class="glyphicon glyphicon-user"> </i>${user1.username}</span></li>
			    <li><span>${type}</span>
			    <c:if test="${user1.username!=null}">
				<li><a class="play-icon popup-with-zoom-anim" href="${pageContext.request.contextPath}/user/logout1">退出 </a></li>
			    </c:if>
			    <c:if test="${user1.username==null}">
				<li><a href="${pageContext.request.contextPath}/user/home1">Login</a></li>
			    </c:if>
			 </ul>
		<div class="top-nav">
			 <ul class="right-icons">
			    <li>
			    <div>
                       <iframe width="455" scrolling="no" height="75" frameborder="0" allowtransparency="true" 
                       src="http://i.tianqi.com/index.php?c=code&amp;id=38&amp;icon=1&amp;num=2&amp;align=left">
                         </iframe>
                 </div>        
               </li>
			</ul>
  </div>
		<div class="clearfix"> </div>
			<!---pop-up-box---->
			    
				<link href="<%=basePath%>css/popuo-box.css" rel="stylesheet" type="text/css" media="all"/>
				<script src="<%=basePath%>js/jquery.magnific-popup.js" type="text/javascript"></script>
			<!---//pop-up-box---->
				<div id="small-dialog" class="mfp-hide">
					   
				</div>
				 
		</div>
		<div class="clearfix"> </div>
		</div>	
<!--//-->	
<div class=" banner-buying">
	<div class=" container">
	
	<div class="clearfix"> </div> 		
	</div>
</div>
<!--//header-->
<!---->
<div class="single">
	<div class="container">
	
		<div class="single-buy">
			<div class="col-sm-3 check-top-single">
				<div class="single-bottom">
					<h4>城市</h4>
						<ul>
							<li>
								<input type="checkbox"  id="brand" value="1">
								<label for="brand"><span></span> 武汉</label>
							</li>
							<li>
								<input type="checkbox"  id="brand1" value="2">
								<label for="brand1"><span></span> 北京</label>
							</li>
							<li>
								<input type="checkbox"  id="brand2" value="5">
								<label for="brand2"><span></span>上海</label>
							</li>
							<li>
								<input type="checkbox"  id="brand3" value="3">
								<label for="brand3"><span></span> 深圳</label>
							</li>
							<li>
								<input type="checkbox"  id="brand4" value="4">
								<label for="brand4"><span></span> 广州</label>
							</li>
							
						</ul>
					</div>
			</div>
			<div class="col-sm-3 check-top-single">
				<div class="single-bottom">
					<h4>价格</h4>
						<ul>
							<li>
								<input type="checkbox"  id="brand5" value="500">
								<label for="brand5"><span></span>500</label>
							</li>
							<li>
								<input type="checkbox"  id="brand6" value="1000">
								<label for="brand6"><span></span>1000~500</label>
							</li>
							<li>
								<input type="checkbox"  id="brand7" value="1999">
								<label for="brand7"><span></span>2000~1000</label>
							</li>
							<li>
								<input type="checkbox"  id="brand8" value="2000">
								<label for="brand8"><span></span>2000+</label>
							</li>
							
						</ul>
					</div>
			</div>
			<div class="col-sm-3 check-top-single">
				<div class="single-bottom">
					<h4>是否出租</h4>
						<ul>
							<li>
								<input type="checkbox"  id="brand9" value="1">
								<label for="brand9"><span></span>已出租</label>
							</li>
							<li>
								<input type="checkbox"  id="brand10" value="2">
								<label for="brand10"><span></span>未出租</label>
							</li>
						</ul>
					</div>
			</div>
			<div class="col-sm-3 check-top-single">
				<div class="single-bottom">
					<h4>重置筛选条件</h4>
						<ul>
							<li>
								<a href="JavaScript:" class="hvr-sweep-to-right more" onclick="sure()">重置</a>
							</li>
						</ul>
					</div>
			</div>	
			<div class="clearfix"> </div>
	</div>
</div>


<div class="container">
	<div class="buy-single">
		<h3>房屋信息</h3>
		<div class="box-sin">
			<div class="col-md-9 single-box">
				<div class="box-col" id="reloadDiv"></div>
		</div>
	
   </div>
</div>
</div>
<div id="dome20"></div>
<script type="text/javascript">
var cityid;  
var price;
var homeway;
$("input").click(function(){
	var  brand= $("#brand").prop("checked");
	var  brand1= $("#brand1").prop("checked");
	var  brand2= $("#brand2").prop("checked");
	var  brand3= $("#brand3").prop("checked");
	var  brand4= $("#brand4").prop("checked");
	var  brand5= $("#brand5").prop("checked");
	var  brand6= $("#brand6").prop("checked");
	var  brand7= $("#brand7").prop("checked");
	var  brand8= $("#brand8").prop("checked");
	var  brand9= $("#brand9").prop("checked");
	var  brand10= $("#brand10").prop("checked");
	if(brand){
		cityid= $("#brand").val();
		$("#brand").attr('checked',true);
		 $("#brand1").attr('checked',false);
		 $("#brand2").attr('checked',false);
		 $("#brand3").attr('checked',false);
		 $("#brand4").attr('checked',false);
	}
	if(brand1){
		cityid= $("#brand1").val();
		$("#brand1").attr('checked',true);
		 $("#brand").attr('checked',false);
		 $("#brand2").attr('checked',false);
		 $("#brand3").attr('checked',false);
		 $("#brand4").attr('checked',false);
	}
	if(brand2){
		cityid= $("#brand2").val();
		$("#brand2").attr('checked',true);
		 $("#brand1").attr('checked',false);
		 $("#brand").attr('checked',false);
		 $("#brand3").attr('checked',false);
		 $("#brand4").attr('checked',false);
	}
	
	if(brand3){
		cityid= $("#brand3").val();
		$("#brand3").attr('checked',true);
		 $("#brand").attr('checked',false);
		 $("#brand2").attr('checked',false);
		 $("#brand1").attr('checked',false);
		 $("#brand4").attr('checked',false);
	}
	if(brand4){
		cityid=$("#brand4").val();
		$("#brand4").attr('checked',true);
		 $("#brand").attr('checked',false);
		 $("#brand2").attr('checked',false);
		 $("#brand3").attr('checked',false);
		 $("#brand1").attr('checked',false);
	}
	if(brand5){
		price=$("#brand5").val();
		$("#brand5").attr('checked',true);
		$("#brand6").attr('checked',false);
		$("#brand7").attr('checked',false);
		$("#brand8").attr('checked',false);
	}
	if(brand6){
		price=$("#brand6").val();
		$("#brand5").attr('checked',false);
		$("#brand6").attr('checked',true);
		$("#brand7").attr('checked',false);
		$("#brand8").attr('checked',false);
	}
	if(brand7){
		price=$("#brand7").val();
		$("#brand5").attr('checked',false);
		$("#brand6").attr('checked',false);
		$("#brand7").attr('checked',true);
		$("#brand8").attr('checked',false);
	}
	if(brand8){
		price=$("#brand8").val();
		$("#brand5").attr('checked',false);
		$("#brand6").attr('checked',false);
		$("#brand7").attr('checked',false);
		$("#brand8").attr('checked',true);
	}
	if(brand9){
		homeway=$("#brand9").val();
		$("#brand9").attr('checked',true);
		$("#brand10").attr('checked',false);
	}
	if(brand10){
		homeway=$("#brand10").val();
		$("#brand9").attr('checked',false);
		$("#brand10").attr('checked',true);
	}
	 $.ajax({
		   type:'post',
		   url:'homeinfo/query1',
		   data:{
			 "cityid": cityid,
			 "price":price,
			 "homeway":homeway
		   },
		   success:function(data){
			   homeinfo(data);
		   }
	   })
});
$(function(){
	
	   $.ajax({
		   type:'post',
		   url:'homeinfo/query1',
		   success:function(data){
			   homeinfo(data);
		   }
	   })
});
	   function homeinfo(data){
		  layui.use('laypage',function(){
		  var laypage = layui.laypage;
		  laypage.render({
			     elem: 'dome20'
			    ,count: data.length
			    ,limit:5
			    ,limits: [5,10,15]
			    ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
			    ,jump: function(obj){
			      //模拟渲染
			      document.getElementById('reloadDiv').innerHTML = function(){
			        var arr = []
			        ,thisData = data.concat().splice(obj.curr*obj.limit - obj.limit, obj.limit);
			        layui.each(thisData, function(index, item){
			        	if(item.cityId==1){
			        		item.cityId="武汉";
			        	}
			        	if(item.cityId==2){
			        		item.cityId="北京";
			        	}
			        	if(item.cityId==3){
			        		item.cityId="深圳";
			        	}
			        	if(item.cityId==4){
			        		item.cityId="广州";
			        	}
			        	if(item.cityId==5){
			        		item.cityId="上海";
			        	}
			        	
			        	if(item.homeMark==1){
			        		item.homeMark="已出租"
			        	}
			        	if(item.homeMark==2){
			        		item.homeMark="未出租"
			        	}
			        	if(item.homeWay==1){
			        		item.homeWay="整租"
			        	}
			        	if(item.homeWay==2){
			        		item.homeWay="合租"
			        	}
			          arr.push(
			        		 '<div class=" col-sm-7 left-side ">'+
							  '<a href="homeinfo/homeinfo"> <img class="img-responsive" src="/img/'+item.coverImg+'" alt="房屋"></a>'+
							'</div>'+				
							'<div class=" col-sm-5 middle-side">'+
			        		  '<p><span class="bath">房屋名称 </span>: <span class="two">'+item.title+'</span></p>'+
						      '<p><span class="bath1">价格 </span>: <span class="two">'+item.price+'/元</span></p>'+
						      '<p><span class="bath2">区域面积</span>: <span class="two">'+item.area+'/㎡</span></p>'+
						     '<p><span class="bath3">所在城市</span>:<span class="two" id="bath3">'+item.cityId+'</span></p>'+
							 '<p><span class="bath4">配套设施</span> : <span class="two" id="bath4">'+item.homeEquipment+'</span></p>'+			 
	                         '<p><span class="bath5">出租方式 </span>:<span class="two" id="bath5">'+item.homeWay+'</span></p>'+	
							 '<p><span class="bath5">出租状态</span>:<span class="two" id="bath6">'+item.homeMark+'</span></p>'+
							 '<div class="   right-side">'+
								 '<a href="JavaScript:" class="hvr-sweep-to-right more" >预定</a>'+     
							 '</div>'+
							 '</div>'
			          );
			        });
			        return arr.join('');
			      }();
			    }
			  });
	   })
   }
function sure(){
		   $("input[type='checkbox']").attr('checked',false);
		    cityid=null;  
		    price=null;
		    homeway=null;
		   $.ajax({
			   type:'post',
			   url:'homeinfo/query1',
			   success:function(data){
				   homeinfo(data);
			   }
		   })
}
   </script>
</div>
<!-- 尾 -->
<div class="footer">
	<div class="container">
		<div class="footer-top-at">
			<div class="col-md-3 amet-sed">
				<h4>Our Company</h4>
				<ul class="nav-bottom">
					<li><a href="demo/404.html">About Us</a></li>
					<li><a href="demo/404.html">For Sale By Owner Blog</a></li>
					<li><a href="demo/404.html">Mobile</a></li>
					<li><a href="demo/404.html">Terms & Conditions</a></li>
					<li><a href="demo/404.html">Privacy Policy</a></li>	
					<li><a href="demo/404.html">Blog</a></li>
					
				</ul>	
			</div>
			<div class="col-md-3 amet-sed ">
				<h4>Work With Us</h4>
					<ul class="nav-bottom">
						<li><a href="demo/404.html">Real Estate Brokers</a></li>
						<li><a href="demo/404.html">Business Development</a></li>
						<li><a href="demo/404.html">Affiliate Programs</a></li>
						<li><a href="demo/404.html">Sitemap</a></li>
						<li><a href="demo/404.html">Careers</a></li>
						<li><a href="demo/404.html">Feedback</a></li>	
					</ul>	
			</div>
			<div class="col-md-3 amet-sed">
				<h4>Customer Support</h4>
				<p>Mon-Fri, 7AM-7PM </p>
				<p>Sat-Sun, 8AM-5PM </p>
				<p>177-869-6559</p>
					<ul class="nav-bottom">
						<li><a href="demo/404.html">Live Chat</a></li>
						<li><a href="demo/404.html">Frequently Asked Questions</a></li>
						<li><a href="demo/404.html">Make a Suggestion</a></li>
					</ul>	
			</div>
			<div class="col-md-3 amet-sed ">
				<h4>Property Services</h4>
				   <ul class="nav-bottom">
						<li><a href="demo/404.html">Residential Property</a></li>
						<li><a href="demo/404.html">Commercial Property</a></li>
						<li><a href="demo/404.html">Login</a></li>
						<li><a href="demo/404.html">Register</a></li>
						<li><a href="typo.html">Short Codes</a></li>	
					</ul>	
					<ul class="social">
						<li><a href="demo/404.html"><i> </i></a></li>
						<li><a href="demo/404.html"><i class="gmail"> </i></a></li>
						<li><a href="demo/404.html"><i class="twitter"> </i></a></li>
						<li><a href="demo/404.html"><i class="camera"> </i></a></li>
						<li><a href="demo/404.html"><i class="dribble"> </i></a></li>
					</ul>
			</div>
		<div class="clearfix"> </div>
		</div>
	</div>
	<div class="footer-bottom">
		<div class="container">
			<div class="col-md-4 footer-logo">
				<h2><a href="index.html">REAL HOME</a></h2>
			</div>
			<div class="col-md-8 footer-class">
				<p >Copyright &copy; 2015.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
			</div>
		<div class="clearfix"> </div>
	 	</div>
	</div>
</div>
<!--//footer-->
</body>
</html>